
pkgname=grep
pkgver=3.1
pkgrel=1
pkgdesc="A string search utility"
arch=('x86_64')
license=('GPL3')
url="https://www.gnu.org/software/grep/grep.html"
groups=('base')
depends=('glibc' 'pcre' 'sh')
makedepends=('texinfo')
source=("https://ftp.gnu.org/gnu/grep/${pkgname}-${pkgver}.tar.xz"
        "http://git.savannah.gnu.org/cgit/grep.git/patch/?id=6e4c8728f0e75af57f839625d0bd51b0a02d091e")
md5sums=('feca7b3e7c7f4aab2b42ecbfc513b070'
         '6a8980630d720e727b4e41efb83d7be4')

build() {
  cd ${pkgname}-${pkgver}
  # http://lists.gnu.org/archive/html/bug-grep/2017-02/msg00008.html
  #patch -p1 -i ${srcdir}/?id=6e4c8728f0e75af57f839625d0bd51b0a02d091e

  ./configure --prefix=/usr --without-included-regex
  make
}

check() {
  cd ${pkgname}-${pkgver}
  
  make check
}

package() {
  cd ${pkgname}-${pkgver}
  
  make DESTDIR=${pkgdir} install
}

